package com.atguigu.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Summerday
 */
public class PageUtils {

    public static Map<String,Object> convertPageToMap(Page page){

        Map<String,Object>map = new HashMap<>();
        map.put("items",page.getRecords());
        map.put("current",page.getCurrent());
        map.put("pages",page.getPages());
        map.put("size",page.getSize());
        map.put("total",page.getTotal());
        map.put("hasNext",page.hasNext());
        map.put("hasPrevious",page.hasPrevious());
        return map;
    }



}
